<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>员工列表</title>
</head>
<body>
<input type="text" placeholder="姓名">
<input type="text" placeholder="工作">
<input type="text" placeholder="工资">
<input type="button" value="添加" >
<table border="1">
    <caption>员工列表</caption>
    <tr>
        <th>姓名</th>
        <th>工作</th>
        <th>工资</th>
    </tr>
</table>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script>
    //给按钮添加点击事件
    $("input:last").click(function (){
        //创建tr
        let tr = $("<tr></tr>");
        //创建3个td
        let td1 = $("<td></td>");
        let td2 = $("<td></td>");
        let td3 = $("<td></td>");
        //把文本框的内容给到td
        td1.text($("input:eq(0)").val());
        td2.text($("input:eq(1)").val());
        td3.text($("input:eq(2)").val());
        //把td装进tr
        tr.append(td1,td2,td3);
        //把tr装进table
        $("table").append(tr);

    });
</script>
</body>
</html>